#ifndef __TEST_ES7210_H_
#define __TEST_ES7210_H_

#include <stdio.h>
#include <string.h>
#include "sdkconfig.h"
#include "esp_check.h"
#include "driver/i2s_tdm.h"
#include "driver/i2c.h"
#include "driver/gpio.h"
#include "sd_card.h"
#include "iic.h"
#include "es7210.h"

/* I2S port and GPIOs */
#define EXAMPLE_I2S_NUM            (I2S_NUM_0)
#define EXAMPLE_I2S_MCK_IO         (GPIO_NUM_38)
#define EXAMPLE_I2S_BCK_IO         (GPIO_NUM_14)
#define EXAMPLE_I2S_WS_IO          (GPIO_NUM_13)
#define EXAMPLE_I2S_DI_IO          (GPIO_NUM_12)

/* I2S configurations */
#define EXAMPLE_I2S_TDM_FORMAT     (ES7210_I2S_FMT_I2S)
#define EXAMPLE_I2S_CHAN_NUM       (2)
#define EXAMPLE_I2S_SAMPLE_RATE    (48000)
#define EXAMPLE_I2S_MCLK_MULTIPLE  (I2S_MCLK_MULTIPLE_256)
#define EXAMPLE_I2S_SAMPLE_BITS    (I2S_DATA_BIT_WIDTH_16BIT)
#define EXAMPLE_I2S_TDM_SLOT_MASK  (I2S_TDM_SLOT0 | I2S_TDM_SLOT1)

/* ES7210 configurations */
#define EXAMPLE_ES7210_I2C_ADDR    (0x41)
#define EXAMPLE_ES7210_I2C_CLK     (100000)
#define EXAMPLE_ES7210_MIC_GAIN    (ES7210_MIC_GAIN_30DB)
#define EXAMPLE_ES7210_MIC_BIAS    (ES7210_MIC_BIAS_2V87)
#define EXAMPLE_ES7210_ADC_VOLUME  (0)

/* SD card & recording configurations */
#define RECORD_TIME_SEC    (10)
#define EXAMPLE_SD_MOUNT_POINT     "/sdcard"
#define RECORD_FILE_PATH   "/RECORD.WAV"

void test_es7210(i2c_obj_t self);

#endif